﻿namespace Kodefu
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public static class EnumerableExtensions
    {
        public static void Run<T>(this IEnumerable<T> sequence, Action<T> action)
        {
            foreach (var item in sequence)
            {
                action(item);
            }
        }

        public static IEnumerable<T> With<T>(this IEnumerable<T> sequence, T item)
        {
            foreach (var t in sequence)
            {
                yield return t;
            }
            yield return item;
        }
    }
}
